<template>
    <div>
        <h2>父组件</h2>
        <h3>{{ gender }}</h3>
        <button @click="gender='女'">修改性别</button>
        <ChildComponent name="张三" :age="20" :gender="gender"/>
        <ChildComponent />
    </div>
</template>

<script setup>
import { ref } from 'vue';
import ChildComponent from './ChildComponent.vue'

const gender = ref('男');
</script>

<style lang="scss" scoped>

</style>